
<script>
import { mapState, mapMutations, mapActions } from 'vuex'
import ls from '@/util/ls'
	export default {
		onLaunch: function() {
			 
				this.init()
		},
		computed:{
			...mapState("app",["user"])
		},
		
		onShow: function(e) {
			
		},
		onHide: function() {
			
		},
		methods:{
			...mapMutations("app",["setUser","setLoginStatus","setSafeAreaInsets"]),
			// ...mapMutations("")
		
		init(){
			wx.loadFontFace({ //加载详情里面的字体
			    global: true, // 关键参数
			    family: 'YouSheBiaoTiHei',
			  //   source: 'url("https://jbgongss.oss-cn-beijing.aliyuncs.com/YouSheBiaoTiHei-Regular.ttf")',
							source: 'url("https://jbgongss.oss-cn-beijing.aliyuncs.com/AlimamaShuHeiTi-Bold.otf")'
			 
			  })
			this.setSafeAreaInsets()
             let user=ls.get("user")
			
             if(user){
                this.setUser(user)
				this.setLoginStatus(1) //已经登录
             }
			 let token=ls.get("token")
			 if(!token){
				 ls.remove("user")
			 }
			
		  }
		}
	}
</script>

<style lang="scss">
@import "@/uni_modules/uview-ui/index.scss";
@import '@/css/index.scss';
	/*每个页面公共css */
</style>
